'use strict';

/**
 * @ngdoc function
 * @name webApp.animation:toTop5
 * @description
 * # toTop5
 * Animation of the webApp
 */
angular.module('webApp')
  .animation('.toTop5Add', function (jqLite) {
    return{
      addClass: function(ele){
        TweenMax.set(ele,{
          display: 'block',
          opacity: 1,
          left: jqLite.$('toTop0')[0].offsetLeft + 'px',
          top: jqLite.$('toTop0')[0].offsetTop + 'px'
        });
        TweenMax.to(ele,0.5,{
          left: jqLite.$('toTop0')[0].offsetLeft - 50 + 'px',
          top: jqLite.$('toTop0')[0].offsetTop - 50 + 'px'
        });
      },
      removeClass: function(ele){
        TweenMax.to(ele,0.5,{
          opacity: 0,
          left: jqLite.$('toTop0')[0].offsetLeft + 'px',
          top: jqLite.$('toTop0')[0].offsetTop + 'px'
        });
      }
    }
  });
